pixelcache: Add a warning for an invariant that shouldn't happen
authorBenjamin Otte <otte@redhat.com>
Wed, 9 Apr 2014 23:53:57 +0000 (01:53 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 9 Apr 2014 23:53:57 +0000 (01:53 +0200)
Pixel caches should be unmapped before being freed and unmapping clears
those variables.

gtk/gtkpixelcache.c

index 339518bf8a9f14e4e619137fe1b5474d3861ec08..4ab8bb954941d8e9a98a6484075e6fec5ea0c373 100644 (file)
@@ -69,6 +69,14 @@ _gtk_pixel_cache_free (GtkPixelCache *cache)
   if (cache == NULL)
     return;
 
+  if (cache->timeout_tag ||
+      cache->surface ||
+      cache->surface_dirty)
+    {
+      g_warning ("pixel cache freed that wasn't unmapped: tag %u surface %p sirty %p",
+                 cache->timeout_tag, cache->surface, cache->surface_dirty);
+    }
+
   if (cache->timeout_tag)
     g_source_remove (cache->timeout_tag);